package cn.ad.server.web.spring.model.bes;

import cn.ad.server.web.spring.model.bes.BES.BidRequest.Mobile;
import cn.ad.server.domain.enumration.Connection;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wangwei
 */
public enum AdBesConnection {


    UNKNOWN(Mobile.WirelessNetworkType.UNKNOWN_NETWORK, Connection.UNKNOWN),
    WIFI(Mobile.WirelessNetworkType.WIFI, Connection.WIFI),
    CELLULAR_NETWORKS_2G(Mobile.WirelessNetworkType.MOBILE_2G, Connection.NET2G),
    CELLULAR_NETWORKS_3G(Mobile.WirelessNetworkType.MOBILE_3G, Connection.NET3G),
    CELLULAR_NETWORKS_4G(Mobile.WirelessNetworkType.MOBILE_4G, Connection.NET4G);

    private Mobile.WirelessNetworkType connectionType;
    private Connection connection;

    public final static Map<Mobile.WirelessNetworkType, Connection> adConnectionMap = new HashMap<>();

    static {
        for (AdBesConnection adViewConnection : AdBesConnection.values()) {
        	adConnectionMap.put(adViewConnection.connectionType, adViewConnection.connection);
        }
    }

    AdBesConnection(Mobile.WirelessNetworkType connectionType, Connection connection) {

        this.connectionType = connectionType;
        this.connection = connection;
    }
}
